<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui" template="/template/template.xhtml"
	xmlns:s="http://sduept.security.el/func">
	<ui:define name="head">
		<title>隐患追踪管理</title>
		<style type="text/css">
.ui-datatable-scrollable-header-box {
	margin-left: 0px;
	margin-right: 15px !important;
}

.ui-datalist-empty-message {
	min-height: 100px;
}

.ui-datalist-content {
	min-height: 100px;
}

.editForm:faultTime_input {
	width: 100px;
	!
	important;
}

#addFaultReportForm .ui-calendar>.ui-state-default {
	border: 0px;
}

.ui-button-icon-only .ui-button-text {
	padding: .3em;
	text-indent: -9999999px;
	height: 27px;
}

/**如果datable使用了：resizableColumns ="true"，需要增加以下样式**/
.ui-datatable-resizable {
	overflow: visible !important;
}
</style>

	</ui:define>
	<ui:define name="content">
		<div id="headDiv" class="box box-solid with-border">
			<h:form id="headForm">
				<p:confirmDialog global="true" showEffect="fade" hideEffect="fade"  >
					<p:commandButton value="是" type="button"
						styleClass="ui-confirmdialog-yes" icon="ui-icon-check" />
					<p:commandButton value="否" type="button"
						styleClass="ui-confirmdialog-no" icon="ui-icon-close" />
				</p:confirmDialog>
				<div class="box-header" id="queryDiv">
					<p:autoComplete id="stationSearch" dropdown="true"
						placeholder="变电站首字母查询" scrollHeight="400"
						value="#{hiddenDangerTrackController.queryParam.substation}"
						style="margin-right:10px"
						completeMethod="#{hiddenDangerTrackController.complateStation}">
					</p:autoComplete>
					<p:outputLabel value="是否完成：" />
					<h:selectOneMenu id="isFinish"
						value="#{hiddenDangerTrackController.queryParam.isFinished}"
						style="width:80px;margin-right:10px;height:30px">
						<f:selectItem itemLabel="全部" itemValue="" />
						<f:selectItem itemLabel="完成" itemValue="1" />
						<f:selectItem itemLabel="未完成" itemValue="0" />
					</h:selectOneMenu>
					<p:outputLabel for="popup7" value="完成时间：" />
					<p:calendar id="popup7" navigator="true"
						value="#{hiddenDangerTrackController.queryParam.queryDateStart}"
						pattern="yyyy-MM-dd" maxdate="Date()" size="12">
					</p:calendar>
					<p:outputLabel for="popup8" value="至 "
						style="margin-right:5px;margin-left:5px;" />
					<p:calendar id="popup8" navigator="true"
						value="#{hiddenDangerTrackController.queryParam.queryDateEnd}"
						pattern="yyyy-MM-dd" maxdate="Date()" size="12">
					</p:calendar>
					<p:commandButton value="查询" id="query2"
						update="form:dataTb headForm:toolbar" icon="ui-icon-search"
						actionListener="#{hiddenDangerTrackController.query}"
						style="margin-left:10px;">
					</p:commandButton>
					<p:commandButton icon="ui-icon-refresh" value="重置"
						actionListener="#{hiddenDangerTrackController.resetQuery}"
						style="margin-left:5px;"
						update=" stationSearch isFinish voltageLevel popup7 popup8 headForm:toolbar form:dataTb  expert  " />
					<div class="box-tools pull-right">
						<button type="button" id="selectButton" title="高级查询"
							class="btn btn-default" onclick="onSelectDivClick();"
							style="margin-right: 50px;">
							<span id="selectButtonIcon" class="fa fa-caret-down">高级查询</span>
						</button>
					</div>
				</div>
				<div class="panel-collapse collapse" id="selectDiv">
					<p:outputLabel value="电压等级：" style="margin-left:10px;" />
					<h:selectOneMenu id="voltageLevel"
						value="#{hiddenDangerTrackController.queryParam.voltage}"
						style="width:120px;height:30px">
						<f:selectItem itemLabel="全部" itemValue="" />
						<f:selectItem itemLabel="500kV及以上" itemValue="499" />
						<f:selectItem itemLabel="220kV及以下" itemValue="221" />
					</h:selectOneMenu>
					<p:outputLabel value="检查专家：" style="margin-left:10px;" />
					<p:autoComplete  id="expert" dropdown="true" placeholder="输入专家首字母查询" scrollHeight="400"
						value="#{hiddenDangerTrackController.queryParam.expertName}" style="margin-right:20px;"
					   completeMethod="#{hiddenDangerTrackController.complateExpert}"	>								  
					</p:autoComplete>
				</div>
				<div id="toolbarDiv">
					<p:toolbar id="toolbar">
						<f:facet name="left">
						    <p:commandButton value="新增" icon="ui-icon-plus"
								update="editForm"
								 /><!-- actionListener="#{hiddenDangerTrackController.preSave}"
								 oncomplete="PF('editDialog').show()" -->
							<p:commandButton value="编辑" icon="ui-icon-pencil"
								disabled="#{hiddenDangerTrackController.selected == null }"
								update="editForm"
								actionListener="#{hiddenDangerTrackController.preEdit}"
								 oncomplete="PF('editDialog').show()" />
							<p:commandButton value="删除" icon="ui-icon-trash"
								actionListener="#{hiddenDangerTrackController.deleteTrack}"
								disabled="#{hiddenDangerTrackController.selected == null}"
								update="form:dataTb form:msgs headForm:toolbar">
								<p:confirm header="提示" message="确定删除该记录吗?" icon="ui-icon-alert" />
							</p:commandButton>
							<p:commandButton value="详细" icon="ui-icon-document"
								disabled="#{hiddenDangerTrackController.selected == null}"
								actionListener="#{hiddenDangerTrackController.changeStatus}"
								update="editForm" oncomplete="PF('editDialog').show()" />
						</f:facet>
					</p:toolbar>
				</div>
			</h:form>
		</div>
		<div id="infoDiv" class="box box-solid with-border">
			<h:form id="form">
				<p:growl id="msgs" showDetail="true" />
				  <p:treeTable id="dataTb" widgetVar="dataTb"   scrollable="true"   scrollHeight="650"
									value="#{hiddenDangerTrackController.trackRoot}" selectionMode="single"
									selection="#{hiddenDangerTrackController.selectedNode}" var="fun" >
									<p:ajax event="select"  update=":headForm:toolbar "
										listener="#{hiddenDangerTrackController.onTreeTableNodeSelect}" />
									<p:ajax event="unselect"  update=":headForm:toolbar"
										listener="#{hiddenDangerTrackController.onNodeUnSelect}" />
									<p:column headerText="计划名称">
										<h:outputText value="#{fun.inspectionPlanName} " />
									</p:column>
									<p:column headerText="隐患等级" cols ="10" >
										<h:outputText value="#{fun.hiddenDangerGrade}"   />
									</p:column>
									<p:column headerText="电压等级">
										<h:outputText value="#{fun.voltageLevel}" />
									</p:column>
									<p:column headerText="被检分子公司">
										<h:outputText value="#{fun.inspectedMoleculeCompany}"   />
									</p:column>
									<p:column headerText="被检单位">
										<h:outputText value="#{fun.inspectedUnit}"   />
									</p:column>
									<p:column headerText="被检变电站">
										<h:outputText value="#{fun.inspectedSubstation}"   />
									</p:column>
									
									<p:column headerText="隐患描述">
										<h:outputText value="#{fun.hiddenDangerDesc} " style="white-space:pre-wrap;" escape="false" />
									</p:column>
									<p:column headerText="问题设备">
										<h:outputText value="#{fun.problemEquipment} " />
									</p:column>
									<p:column headerText="整改方案">
										<h:outputText value="#{fun.rectificationPlan} " style="white-space:pre-wrap;" escape="false" />
									</p:column>
				</p:treeTable>
			</h:form>
		</div>
		<!-- 编辑故障弹窗 -->
	<h:form id="editForm"  >
		<p:dialog widgetVar="editDialog" header="隐患追踪" modal="true"
			id="editDialog" width="1400" height="700" scrollable="true">
				<p:toolbar>
					<f:facet name="left">
						<p:commandButton value="保存" icon="ui-icon-disk"
							oncomplete="PF('editDialog').hide()  "
							update=":form:dataTb  :form:msgs   :headForm:toolbar"
							actionListener="#{hiddenDangerTrackController.updateTrack}"
							rendered="#{hiddenDangerTrackController.status}" />
						<p:commandButton value="取消" icon="ui-icon-cancel"
							oncomplete="PF('editDialog').hide()"
							rendered="#{hiddenDangerTrackController.status}" />
						<p:commandButton value="确定" icon="ui-icon-disk"
							oncomplete="PF('editDialog').hide()"
							rendered="#{!hiddenDangerTrackController.status}" update=":form:dataTb" />
					</f:facet>
				</p:toolbar>
				<p:panel header = "设备信息">
				<p:panelGrid id="设备信息" header="设备信息" style="margin-top:10px;" styleClass="ui-noborder">
				    <p:row >
				       <p:column>
				          <p:outputLabel value="电压等级：" />
				       </p:column>
				       <p:column>
				        <p:autoComplete id="basic"
							value="#{hiddenDangerTrackController.selected.voltageLevel}"
							completeMethod="#{hiddenDangerTrackController.completeVoltage}"
							scrollHeight="400" dropdown="true" />
				       </p:column>
				       <p:column>
				          <p:outputLabel value="间隔名称：" />
				       </p:column>
				       <p:column>
				        <p:inputText	value="#{hiddenDangerTrackController.selected.intervaName}" />
				       </p:column>
				        <p:column>
				          <p:outputLabel value="存在问题设备：" />
				       </p:column>
				       <p:column>
				      <p:inputText value="#{hiddenDangerTrackController.selected.problemEquipment}" />
				       </p:column>
				    </p:row>
				</p:panelGrid>
				</p:panel >
				<p:panel id="单位信息" header="单位信息 ">
					<p:panelGrid styleClass="ui-noborder" id="grid1" width="100">
					 <p:row >
				       <p:column>
				          <p:outputLabel value="被检分子公司 ：" />
				       </p:column>
				       <p:column>
				         <p:inputText value="#{hiddenDangerTrackController.selected.inspectedMoleculeCompany}" />
				       </p:column>
				       <p:column>
				           <p:outputLabel value="被检变电站：" />
				       </p:column>
				       <p:column>
				           <p:inputText	value="#{hiddenDangerTrackController.selected.inspectedSubstation}" />
				       </p:column>
				       <p:column>
				          <p:outputLabel value="被检单位:" />
				       </p:column>
				       <p:column>
				           <p:inputText value="#{hiddenDangerTrackController.selected.inspectedUnit}" />
				       </p:column>
				    </p:row>
					<p:row >
				       <p:column>
				          <p:outputLabel value="责任单位 ：" />
				       </p:column>
				       <p:column>
				         <p:inputText  value="#{hiddenDangerTrackController.selected.responsibleUnit}" />
				       </p:column>
				       <p:column>
				           <p:outputLabel value="专家派出分子公司：" />
				       </p:column>
				       <p:column>
				           <p:inputText	value="#{hiddenDangerTrackController.selected.expertOfCompany}" />
				       </p:column>
				     </p:row>	
					</p:panelGrid>
				</p:panel>
				<p:panel id="人员信息" header="人员信息 ">
					<p:panelGrid styleClass="ui-noborder" border="0px" width="100"	>
					 <p:row >
				       <p:column>
				          <p:outputLabel value="检查专家：" />
				       </p:column>
				       <p:column>
				         <p:inputText value="#{hiddenDangerTrackController.selected.inspectionExpert}" />
				       </p:column>
				       <p:column>
				           <p:outputLabel value="迎检人员：" />
				       </p:column>
				       <p:column>
				           <p:inputText	value="#{hiddenDangerTrackController.selected.checkInPerson}" />
				       </p:column>
				       <p:column>
				          <p:outputLabel value="整改负责人员:" />
				       </p:column>
				       <p:column>
				           <p:inputText value="#{hiddenDangerTrackController.selected.personOfRectifyTel}" />
				       </p:column>
				     </p:row>
					 <p:row >
				       <p:column>
				          <p:outputLabel value="检查专家电话：" />
				       </p:column>
				       <p:column>
				         <p:inputText value="#{hiddenDangerTrackController.selected.inspectionExpertTel}" />
				       </p:column>
				       <p:column>
				           <p:outputLabel value="迎检人员电话：" />
				       </p:column>
				       <p:column>
				           <p:inputText	value="#{hiddenDangerTrackController.selected.checkInPersonTel}" />
				       </p:column>
				       <p:column>
				          <p:outputLabel value="整改负责人员电话:" />
				       </p:column>
				       <p:column>
				           <p:inputText value="#{hiddenDangerTrackController.selected.personOfRectifyTel}" />
				       </p:column>
				     </p:row>
					</p:panelGrid>
				</p:panel>
				<p:panel id="评价信息" header="评价信息 ">
					<p:panelGrid styleClass="ui-noborder" width="100" >
					 <p:row >
				       <p:column>
				          <p:outputLabel value="评价项目：" />
				       </p:column>
				       <p:column>
				         <p:inputText value="#{hiddenDangerTrackController.selected.inspectionPlanName}" />
				       </p:column>
				       <p:column>
				           <p:outputLabel value="检查子项：" />
				       </p:column>
				       <p:column>
				           <p:inputText	value="#{hiddenDangerTrackController.selected.checkSubitem}" />
				       </p:column>
				       <p:column>
				          <p:outputLabel value="管辖专业：" />
				       </p:column>
				       <p:column>
				            <p:autoComplete id="jSpecialty" value="#{hiddenDangerTrackController.selected.jurisdictionalSpecialty}"
							      completeMethod="#{hiddenDangerTrackController.completeHiddenDangerJSpecialty}" 
							      scrollHeight="400" dropdown="true" >
							</p:autoComplete>
				       </p:column>
				     </p:row>
					 <p:row >
				       <p:column>
				          <p:outputLabel value="对应表单规范序号：" />
				       </p:column>
				       <p:column>
				         <p:inputText value="#{hiddenDangerTrackController.selected.specificationNumber}" />
				       </p:column>
				       <p:column>
				           <p:outputLabel value="序号：" />
				       </p:column>
				       <p:column>
				           <p:inputText	value="#{hiddenDangerTrackController.selected.sno}" />
				       </p:column>
				       <p:column>
				          <p:outputLabel value="检查要素及要求：" />
				       </p:column>
				       <p:column>
				           <p:inputText value="#{hiddenDangerTrackController.selected.elementAndRequest}" />
				       </p:column>
				     </p:row>
					  <p:row >
				       <p:column>
				          <p:outputLabel value="对应分类：" />
				       </p:column>
				       <p:column>
				         <p:autoComplete id="classify"
								value="#{hiddenDangerTrackController.selected.classify}"
								completeMethod="#{hiddenDangerTrackController.completeClassify}"
								scrollHeight="400" dropdown="true" />
				       </p:column>
				       <p:column>
				           <p:outputLabel value="问题归类：" />
				       </p:column>
				       <p:column>
				          <p:autoComplete id="hiddenDangerQuesClass" value="#{hiddenDangerTrackController.selected.hiddenDangerProblemClass}"
							     completeMethod="#{hiddenDangerTrackController.completeHiddenDangerQuesClass}" 
							     scrollHeight="400" dropdown="true" >
						  </p:autoComplete>
				       </p:column>
				       <p:column>
				          <p:outputLabel value="原因归类：" />
				       </p:column>
				       <p:column>
				           <p:autoComplete id="hiddenDangerReasonClass" value="#{hiddenDangerTrackController.selected.hiddenDangerReasonClass}"
							      completeMethod="#{hiddenDangerTrackController.completeHiddenDangerReasonClass}" 
							      scrollHeight="400" dropdown="true" >
							</p:autoComplete>
				       </p:column>
				     </p:row>
					 <p:row >
				       <p:column>
				          <p:outputLabel value="评分标准：" />
				       </p:column>
				       <p:column>
				         <p:inputText value="#{hiddenDangerTrackController.selected.scoreCriteria}" />
				       </p:column>
				       <p:column>
				           <p:outputLabel value="得分情况：" />
				       </p:column>
				       <p:column>
				           <p:inputText	value="#{hiddenDangerTrackController.selected.scores}" />
				       </p:column>
				       <p:column>
				          <p:outputLabel value="扣分情况：" />
				       </p:column>
				       <p:column>
				           <p:inputText value="#{hiddenDangerTrackController.selected.scoreDeduction}" />
				       </p:column>
				      </p:row>
				      <p:row >
				       <p:column>
				          <p:outputLabel value="隐患等级：" />
				       </p:column>
				       <p:column>
				         <p:autoComplete id="hiddenDangerGrade"
								value="#{hiddenDangerTrackController.selected.hiddenDangerGrade}"
								completeMethod="#{hiddenDangerTrackController.completeHiddenGrade}"
								scrollHeight="400" dropdown="true" />
				       </p:column>
				       <p:column>
				           <p:outputLabel value="隐患来源：" />
				       </p:column>
				       <p:column>
				           <p:autoComplete id="hiddenDangerSources" value="#{hiddenDangerTrackController.selected.sourcesOfHiddenDanger}"
								 completeMethod="#{hiddenDangerTrackController.completeHiddenDangerSources}"
								 scrollHeight="400" dropdown="true" />
				       </p:column>
				      </p:row>
				      <p:row >
				       <p:column>
				          <p:outputLabel value="隐患描述:" />
				       </p:column>
				       <p:column colspan="3"  >
				         <p:inputTextarea rows="3"  cols="60"
								value="#{hiddenDangerTrackController.selected.hiddenDangerDesc}"
								autoResize="false" style="width:100%" id="hiddenDangerDesc" />
				       </p:column>
				      </p:row>
					</p:panelGrid>
				</p:panel>
				<p:panel id="整改信息"  header="整改信息 "   >
				    <p:panelGrid  styleClass="ui-noborder" border ="0px"  width="100"  > 
				        <p:row >
					       <p:column>
					          <p:outputLabel value="整改计划时间：" />
					       </p:column>
					       <p:column>
					         <p:calendar value="#{hiddenDangerTrackController.selected.rectifyPlanTime}" navigator="true"
							pattern="yyyy-MM-dd HH:mm:ss" showHour="true" showMinute="true" showSecond="true" />
					       </p:column>
					       <p:column>
					           <p:outputLabel value="整改完成时间：" />
					       </p:column>
					       <p:column>
					           <p:calendar size="22" value="#{hiddenDangerTrackController.selected.completTimeOfRectify}" navigator="true"
							   pattern="yyyy-MM-dd HH:mm:ss" showHour="true" showMinute="true" showSecond="true" />
					       </p:column>
					       <p:column>
					          <p:outputLabel value="是否完成整改：" />
					       </p:column>
					       <p:column>
					           <h:selectOneMenu id="rectifyFinished" value="#{hiddenDangerTrackController.selected.rectifyFinished}"
									style="width:160px;height:30px">
									<f:selectItem itemLabel="完成" itemValue="1" />
									<f:selectItem itemLabel="未完成" itemValue="0" />
							   </h:selectOneMenu>
					       </p:column>
				        </p:row>
				        <p:row >
				           <p:column>
					           <p:outputLabel value="月度整改进度：" />
					       </p:column>
					       <p:column>
					          <p:inputText id="monthRectifyProgress" value="#{hiddenDangerTrackController.selected.monthRectifyProgress}"/>
					       </p:column>
					       <p:column >
					          <p:outputLabel value="整改计划及进度：" />
					       </p:column>
					       <p:column  colspan="2" >
					          <p:inputText size="22" value="#{hiddenDangerTrackController.selected.rectifyPlanProgress}" />
					       </p:column>
				      </p:row>
				      <p:row >
					       <p:column>
					          <p:outputLabel value="整改方案:" />
					       </p:column>
					       <p:column colspan="3"  >
					         <p:inputTextarea rows="3"  cols="60"
									value="#{hiddenDangerTrackController.selected.rectificationPlan}"
									autoResize="false" style="width:100%" id="rectificationPlan" />
					       </p:column>
				      </p:row>
				    </p:panelGrid>
				</p:panel>
					<p:panel id="其他" header="其他 ">
					<p:panelGrid styleClass="ui-noborder" border="0px" width="100">
						   <p:row >
						       <p:column>
						          <p:outputLabel value="被检单位意见：" />
						       </p:column>
						       <p:column>
						             <p:inputTextarea rows="3"  cols="60" value="#{hiddenDangerTrackController.selected.opinionsOfUint}"
								     autoResize="false" />
						       </p:column>
				           </p:row>
				           <p:row >
						       <p:column>
						          <p:outputLabel value="申诉说明：" />
						       </p:column>
						       <p:column>
							        <p:inputTextarea rows="3" cols="60" value="#{hiddenDangerTrackController.selected.stateOfUnit}"
									autoResize="false" id="stateOfUnit">
								    </p:inputTextarea>
						       </p:column>
				           </p:row>
				           <p:row >
						       <p:column>
						          <p:outputLabel value="备注：" />
						       </p:column>
						       <p:column>
							        <p:inputTextarea rows="3" cols="60" value="#{hiddenDangerTrackController.selected.remark}"
								    	autoResize="false"  id="description1">
								     </p:inputTextarea>
						       </p:column>
				           </p:row>
				       </p:panelGrid>
				</p:panel>
		    </p:dialog>
	 </h:form>
	</ui:define>
	<ui:define name="contentend">
		<script src="/resources/js/tables/singleScrollTable.js" />
		<script
			src="/ui/map/dialog/riskAlarmDialog/searchAlarmMsgDlg.js?version=1.0" />
	</ui:define>
</ui:composition>